# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: Hannes Braun <hannes@hannesbraun.net>
pkgname=sdl2_ttf
pkgver=2.22.0
pkgrel=0
pkgdesc="A library which allows you to use TrueType fonts in your SDL applications"
url="https://github.com/libsdl-org/SDL_ttf"
arch="all"
license="Zlib"
makedepends="
	cmake
	freetype-dev
	harfbuzz-dev
	mesa-dev
	samurai
	sdl2-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/libsdl-org/SDL_ttf/releases/download/release-$pkgver/SDL2_ttf-$pkgver.tar.gz"
builddir="$srcdir"/SDL2_ttf-$pkgver
options="!check"  # no test suite

# secfixes:
#   2.20.0-r0:
#     - CVE-2022-27470

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSDL2TTF_HARFBUZZ=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
34a1d210d8f1b1e802139d65ba47e36033bb7881e75a8862c1b1c515565bef85e3d81ee42e952aa664de043debef387ba60088a9cf3ba3297413db39a13af912  SDL2_ttf-2.22.0.tar.gz
"
